package com.qqt.csr.archive.entity.reader;

import com.qqt.csr.archive.enums.FlowType;
import com.qqt.csr.archive.enums.MessageType;
import com.qqt.csr.common.enums.DeletedEnum;
import com.qqt.csr.common.sensitiveword.SensitiveWordMsg;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @Author: yang hao
 * @Date: 2024/11/19 15:55
 * @Description: 人工客服 消息
 **/
@Data
@Schema(description = "人工客服消息")
@Document(collection = "im_message")
public class ArtificialMessage implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "消息id")
    private String id;

    @Indexed(name = "idx_seq")
    @Schema(description = "消息序号")
    private String seq;

    @Schema(description = "发送方")
    @Field(value = "sender._id")
    private String sender;

    @Schema(description = "接收方")
    @Field(value = "recipient._id")
    private String recipient;

    @Indexed(name = "idx_conId")
    @Schema(description = "会话id")
    private String conversationId;

    @Schema(description = "消息内容")
    private Object content;

    @Schema(description = "消息类型")
    private MessageType type;

    @Schema(description = "扩展信息")
    private String artificialExt;

    @Schema(description = "消息流类型")
    private FlowType flow;

    @Schema(description = "是否删除，0：未删除，1：已删除")
    private DeletedEnum deleted;

    @Schema(description = "创建时间")
    private String createTime;

    @Schema(description = "更新时间")
    private String updateTime;

    @Schema(description = "所属房间")
    private String roomId;

    @Schema(description = "命中的敏感词位置")
    private List<SensitiveWordMsg> sensitiveWords;

}
